package com.linewow.xhyy.nihaonew.activity;

import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.linewow.xhyy.nihaonew.R;
import com.linewow.xhyy.nihaonew.activity.user.AdviceActivity;
import com.linewow.xhyy.nihaonew.activity.user.LanguageActivity;
import com.linewow.xhyy.nihaonew.base.BaseActivity;
import com.linewow.xhyy.nihaonew.util.DataCleanManager;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by LXR on 2016/11/8.
 */
public class ConfigureBlankActivity extends BaseActivity {
    @Bind(R.id.toolbar_back_title)
    TextView toolbarBackTitle;
    @Bind(R.id.toolbar_back_left)
    ImageView toolbarBackLeft;
    @Bind(R.id.configure_language)
    TextView configureLanguage;
    @Bind(R.id.configure_language_rela)
    RelativeLayout configureLanguageRela;
    @Bind(R.id.configure_cache_rela)
    RelativeLayout configureCacheRela;
    @Bind(R.id.configure_advice)
    RelativeLayout configureAdvice;

    private String TAG="ConfigureBlankActivity";

    @Override
    public void initView() {
        super.initView();
        setContentView(R.layout.activity_configure_blank);
        ButterKnife.bind(this);
        configureLanguage.setText(getString(R.string.app_language));
        toolbarBackTitle.setText(getString(R.string.title_configure));
    }

    @Override
    public void initList() {
        super.initList();
    }


    @OnClick({R.id.toolbar_back_left, R.id.configure_language_rela, R.id.configure_cache_rela, R.id.configure_advice})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.toolbar_back_left:
                finish();
                break;
            case R.id.configure_language_rela:
                Intent intent2=new Intent(ConfigureBlankActivity.this,LanguageActivity.class);
                startActivity(intent2);

                break;
            case R.id.configure_cache_rela:
                String cacheSize= DataCleanManager.cleanAppCache(ConfigureBlankActivity.this);
                Log.e(TAG,"清除了缓存"+cacheSize);
                showCanDialog(cacheSize);
                break;
            case R.id.configure_advice:
                Intent intent3=new Intent(ConfigureBlankActivity.this, AdviceActivity.class);
                startActivity(intent3);
                break;
        }
    }
}
